
import 'package:flutter_ahj_app/app/HttpRequest.dart';
import 'package:flutter_ahj_app/base/basewidget/model/BaseModel.dart';
import 'package:rxdart/rxdart.dart';

class SHModel extends BaseModel {
  // 用户信息
  BehaviorSubject<Map> _getUserInfoObservable;
  Stream<Map> get getUserInfoDataStream => _getUserInfoObservable.stream;
  getUserInfo() {
    _getUserInfoObservable =  BehaviorSubject();
    HttpRequest.userInfoRequest().listen((result){
      _getUserInfoObservable.add(result);
    },onError: (e){
      errorData.add(e);
    });
  }

  @override
  void dispose() {
    super.dispose();
    if (_getUserInfoObservable != null) _getUserInfoObservable.close();
  
  }
}